class ResponseModel {
  int code;
  String msg;
  Data data;

  ResponseModel({
    required this.code,
    required this.msg,
    required this.data,
  });

  factory ResponseModel.fromJson(Map<String, dynamic> json) {
    return ResponseModel(
      code: json['code'],
      msg: json['msg'],
      data: Data.fromJson(json['data']),
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'code': code,
      'msg': msg,
      'data': data.toJson(),
    };
  }
}

class Data {
  List<Item> list;

  Data({
    required this.list,
  });

  factory Data.fromJson(Map<String, dynamic> json) {
    var listJson = json['list'] as List;
    return Data(
      list: listJson.map((item) => Item.fromJson(item)).toList(),
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'list': list.map((item) => item.toJson()).toList(),
    };
  }
}

class Item {
  String id;
  String name;

  Item({
    required this.id,
    required this.name,
  });

  factory Item.fromJson(Map<String, dynamic> json) {
    return Item(
      id: json['id'],
      name: json['name'],
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'id': id,
      'name': name,
    };
  }
}